import os
import unittest
from cases.Base_Case import BASECASE
from config.config import DATA_PATH
from page.index import IndexPage
from page.住院医生站.住院医生站.zhuyuanyishengzhan__page import zhuyuanyishengzhan
from tools.sjqd_way import read_data_from_excel
class TestZhuyuanyishengzhan_Tingchangqiyizhu(BASECASE):
    @classmethod
    def setUpClass(cls):
        ap = IndexPage()
        ap.jrym_no1('住院医生站')
    @classmethod
    def tearDownClass(cls):
        ap = IndexPage()
        ap.close_all_xxk()
        print("{}执行完毕-------------------------------------------------".format(cls))
    # @unittest.skip
    #停止长期医嘱
    def test_1_tingchangqiyizhu(self):
        self.data = read_data_from_excel(os.path.join(DATA_PATH, "datas.xls"), "测试患者")
        name = self.data[0][0]
        bp = zhuyuanyishengzhan()
        bp.input_hzxm(name)  # 输入患者姓名
        self.data = read_data_from_excel(os.path.join(DATA_PATH, "datas.xls"), "住院医生站")
        ssbr,zyzt = self.data[0][0]
        bp.click_ssbr(ssbr)  # 选择所属患者
        bp.click_zyzt(zyzt)  # 选择在院状态
        bp.click_cx_btn()  # 点击查询按钮
        bp.click_hz1()  # 点击患者1
        bp.click_cqyz()  # 点击长期医嘱
        bp.stop_cqyz() #停止长期医嘱
        bp.click_stopyzqd()#点击确定按钮

if __name__ == '__main__':
    unittest.main()